(Dear All, I have sent this email last week, but I did not see it in the list ) Thanks to all the kind ArcViewers who responded to my question ! The Original question: ==================================================== ==================================================== Dear ArcViewers, I would like to know what would be the best way to recognize documents types in an AV projects. I am having problems in getting the existing dialogs. My script lines go something like: TheList = av.getproject.getdocs MyList = Thelist.clone For each d in MyList WHAT SHOULD I PUT HERE TO RECOGNIZE THE DOC TYPE (view, table, SEd ...) I could put, but what about dialogs ?: if (d.is(view)) then msgbox.info("My Doc is a View","") end 'if (d.is(view)) then end 'For each d in MyList Thank you in advance for your help. Regards. Lyes MOKRAOUI ==================================================== ==================================================== ============= Responses : ============ Rolf Aa. Broch I think you can recognize dialogs by replacing "view" in your code below with "DialogEditor". ==================================================== Andrew Wright You're on the right track with the Is(View) stuff - that's how you have to test for document type. Dialogs are considered layout documents for some reason. I don't know why ESRI did that, but what can we do right? ==================================================== Hi Lyes, Dialogs are not part of ArcView documents. They do not inherit from Doc object, so this way you won't be able to access them. Dialogs inherit from Window object, which is slightly different from Doc. See help on 'Dialog'. To access the dialogs use "av.getproject.GetDialogs" statement that gets a NameDictionary containing all the dialogs in the project. Let me know how it goes. Raj Dutt ==================================================== Quantitative Decisions Lyes, At 04:45 PM 11/19/01 -0800, you wrote: WHAT SHOULD I PUT HERE TO RECOGNIZE THE DOC TYPE (view, table, SEd ...) I could put, but what about dialogs ?: You can find out for yourself with a bit of code like s = "Document list:" for each d in av.GetProject.GetDocs s = s + NL + d.GetName.Quote ++ "is a" ++ d.GetClass.GetClassName end MsgBox.Report(s, "Document types") ' end of script --Bill Huber www.quantdec.com ==================================================== valeria@geoambiente.com.br Hi Lyes, This is how to retrieve dialogs from a project. Dialogs you have created you can add to your project with av.GetProject.AddDialog(theDia). Remember, to name your dialog first with theDia.SetName("test") To retrieve your dialog from the project, use av.GetProject.FindDialog("test") If you want to know what dialogs are resident in your project use av.GetProject.GetDialogs, this returns a dictionary with the names of the dialogs as keys. Lots of succes. Bertus van 't Wout the Netherlands ==================================================== Vitor Coneglian Franchito Hi Lyes MOKRAOUI, In d.is(view), change view to DialogEditor, then you can find de docs which are dialogs Regards, Vitor Coneglian Franchito [ vitor@geoambiente.com.br ] Setor: Desenvolvimento de Sistemas Geoambiente Sensoriamento Remoto S/C Ltda Av. Anchieta, 117 - Jardim Nova Europa CEP 12242-280 - São José dos Campos - SP - Brasil Tel/Fax: (55) - 012 - 3941.1251 Visite-nos na Internet: www.geoambiente.com.br ====================================================